<?php
/**
 * @email wei@alipay168.cn
 * @author 小韦
 * @link http://blog.alipay168.cn
 * @Date: 2020/6/6 16:13
 */

namespace app\common\model;


class Formid extends BaseModel
{
    protected $name = 'formid';
    protected $pk = 'id';

    /**
     * 添加新记录
     * @param $user_id
     * @param $form_id
     * @return bool|int
     */
    public static  function add($user_id, $form_id)
    {
        if (empty($user_id) || empty($form_id)) {
            return false;
        }
        $data['app_id'] = self::$app_id;
        $data['user_id'] = $user_id;
        $data['form_id'] = $form_id;


        if ((new Formid)->allowField(true)->save($data)) {
            return true;
        }
        return false;
    }

    public static function getAvailable($user_id)
    {

    }
}